object ConstructorDemo04 {
  def main(args: Array[String]): Unit = {
    val worker1 = new Worker("smith1")

    val worker2 = new Worker2("smith2")

    println(worker2.inName)
    val worker3 = new Worker3("smith3")
    worker3.inName = "mary"
    println(worker3.inName)
  }
}

class Worker(inName: String) {
  var name = inName
}
class Worker2(val inName: String) {
  var name = inName
}
class Worker3(var inName: String) {
  var name = inName
}